using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;

namespace Hack.Authorization {
	/// <summary>
	/// User Info Properties
	/// </summary>
	[DataContract(Namespace = "http://digitalfortress.com", Name = "User")]
	public partial class User {

		#region Fields
		private System.Guid _userId;
		private string _userName;
		private Int16 _simultaneousAccess = 1;
		private Application _application;		
		private Membership _membership;
		private System.DateTime createDate;
		private bool isBlocked;
		private DateTime? blockedSince;
		private DateTime? unblockedSince;
		#endregion Fields

		#region Properties
		/// <summary>
		/// UserId Property Name.
		/// </summary>
		public const string UserIdProperty = "UserId";
		/// <summary>
		/// User Id.
		/// </summary>
		[DataMember(IsRequired = false, Name = UserIdProperty, Order = 0)]
		public System.Guid UserId {
			get {
				return this._userId;
			}
			set {
				this._userId = value;
			}
		}

		/// <summary>
		/// User name property name.
		/// </summary>
		public const string UserNameProperty = "UserName";
		/// <summary>
		/// User name.
		/// </summary>
		[DataMember(IsRequired = false, Name = UserNameProperty, Order = 1)]
		public string UserName {
			get {
				return this._userName;
			}
			set {
				this._userName = value;
			}
		}

		/// <summary>
		/// SimultaneousAccess property name.
		/// </summary>
		public const string SimultaneousAccessProperty = "SimultaneousAccess";
		/// <summary>
		/// How many simultaneous sessions this user is allowed. Defaults to 1.
		/// If this is set to 0, the user may connect as many times as he desires.
		/// </summary>
		[DataMember(IsRequired = false, Name = SimultaneousAccessProperty, Order = 2)]
		public Int16 SimultaneousAccess {
			get {
				return this._simultaneousAccess;
			}
			set {
				this._simultaneousAccess = value;
			}
		}

		/// <summary>
		/// Application property name.
		/// </summary>
		public const string ApplicationProperty = "Application";
		/// <summary>
		/// Application that this user belongs to.
		/// </summary>
		[DataMember(IsRequired = false, Name = ApplicationProperty, Order = 3)]
		public Application Application {
			get {
				return this._application;
			}
			set {
				this._application = value;
			}
		}

		/// <summary>
		/// Membership property name.
		/// </summary>
		public const string MembershipProperty = "Membership";
		/// <summary>
		/// Membership of this user.
		/// </summary>
		[DataMember(IsRequired = false, Name = MembershipProperty, Order = 4)]
		public Membership Membership {
			get {
				return this._membership;
			}
			set {
				this._membership = value;
			}
		}

		/// <summary>
		/// CreatedDate Property Name.
		/// </summary>
		public const string CreateDateProperty = "CreatedDate";
		/// <summary>
		/// Date that this user was created.
		/// </summary>
		[DataMember(IsRequired = false, Name = CreateDateProperty, Order = 5)]
		public DateTime CreateDate {
			get {
				return this.createDate;
			}
			set {
				this.createDate = value;
			}
		}

		/// <summary>
		/// IsBlocked Property Name.
		/// </summary>
		public const string IsBlockedProperty = "IsBlocked";
		/// <summary>
		/// Indicates whether this user is blocked or not. This value is false when the
		/// user is created.
		/// </summary>
		[DataMember(IsRequired = true, Name = IsBlockedProperty, Order = 6)]
		public bool IsBlocked {
			get {
				return isBlocked;
			}
			set {
				isBlocked = value;
			}
		}

		/// <summary>
		/// BlockedSince Property Name.
		/// </summary>
		public const string BlockedSinceProperty = "BlockedSince";
		/// <summary>
		/// If the user is blocked, indicates when was the blocking date for this user.
		/// Otherwise this is null.
		/// This value defaults to null.
		/// </summary>
		[DataMember(IsRequired = true, Name = BlockedSinceProperty, Order = 7)]
		public DateTime? BlockedSince {
			get {
				return blockedSince;
			}
			set {
				blockedSince = value;
			}
		}

		/// <summary>
		/// UnblockedSince Property Name.
		/// </summary>
		public const string UnblockedSinceProperty = "UnblockedSince";
		/// <summary>
		/// If the user is unblocked, indicates when was the unblocking date for this user.
		/// Otherwise this is null.
		/// This value defaults to the CreateDate.
		/// </summary>
		[DataMember(IsRequired = true, Name = UnblockedSinceProperty, Order = 8)]
		public DateTime? UnblockedSince {
			get {
				return unblockedSince;
			}
			set {
				unblockedSince = value;
			}
		}
		#endregion Properties
	}
}
